Skip to content

Added area of a triangle. - #7710

Closed
NickP6298 wants to merge 1 commit into
TheAlgorithms:masterfrom
NickP6298:new_branch
Closed

NickP6298 wants to merge 1 commit into
TheAlgorithms:masterfrom
NickP6298:new_branch

Conversation

@NickP6298

Copy link
Copy Markdown
  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new algorithms include a corresponding test class that validates their functionality.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

if (slantHeight <= 0) {
throw new IllegalArgumentException("Must be a positive slantHeight");
}
double baseArea = sideLength * sideLength;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple calculation of base times height :)

@DenizAltunkapan

Copy link
Copy Markdown
Member

Thanks for your contribution. The PR title suggests an implementation for calculating the area of a triangle, but the actual changes add another surfaceAreaPyramid() method, which already exists in Area.java. Furthermore, the new method is placed outside the class declaration, resulting in invalid Java syntax. Closing this PR due to the incorrect implementation, duplicate functionality, and compilation issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants